/*******************************************************************************
*  file    : main.cpp
*  created : 15.08.2013
*  author  : Slyshyk Oleksiy (alexSlyshyk@gmail.com)
*******************************************************************************/

#include <QCoreApplication>
#include <QDebug>
#include <QTextCodec>
#include <iostream>
#include <qt_windows.h>

BOOL CALLBACK EnumCodePagesProc(LPTSTR lpCodePageString)
{
    std::wcout<<lpCodePageString<<std::endl;
    return TRUE;
}

int main(int argc, char* argv[])
{
    QCoreApplication a(argc, argv);

    EnumSystemCodePages(EnumCodePagesProc, CP_INSTALLED);
    QTextCodec::setCodecForLocale( QTextCodec::codecForName("UTF-8") );

    if (SetConsoleOutputCP(65001))
        {
            qDebug()<<QStringLiteral("привет UTF-8 !!!");
            qDebug()<<QString("ПРИВЕТ 123").toUtf8();
            std::cout<<"hello = привет"<<std::endl;
            std::wcout<<L"hello = привет"<<std::endl;
        }
    else
        {
            qDebug()<<QStringLiteral("пока UTF-8 ---");
        }

    
    return 0;//a.exec();
}
